<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<th:block th:fragment="My97DatePicker">
  <script th:src="@{/My97DatePicker/WdatePicker.js}"></script>
</th:block>
<th:block th:fragment="default">
  <style>
    .f-red {
      color: #FF5722;
    }

    .hide {
      display: none;
    }

    .root_open:before {
      content: "\e625";
    }

    .root_close:before {
      content: "\e623";
    }
  </style>

  <script th:src="@{/webjars/jquery/3.3.1-2/jquery.min.js}"></script>
  <script th:inline="javascript">
    var path = [[${#httpServletRequest.getContextPath()}]];
  </script>
  <script>
    function debounce(fn, delay){
      var timer = null; //借助闭包
      return function(){
        var context = this,
          args = arguments;
        timer && clearTimeout(timer);
        timer = setTimeout(function(){
          fn.apply(context, args);
        },delay);
      }
    }
    function selectImg(action, flag) {
      var URL = path + "/mongo/fileImgSelect?flag=" + flag
         + "&multi=" + action;

      layer.open({
        type: 2,
        area: ['700px', '530px'],
        content: URL
      });
    }
    function repeat(formData, msg) {
      var txt = "";
      var URL = path + "/verify/repeat";
      $.ajax({
        url: URL,
        type: 'POST',
        data: formData,
        datatype: 'json',
        async: false,
        success: function (jsonData) {
          if (jsonData.flag) {
            txt = msg;
          }
        }
      });
      return txt;
    }

    function repeatAppId(formData, msg) {
      var txt = "";
      var URL = path + "/wechat/verify/repeatAppId";
      $.ajax({
        url: URL,
        type: 'POST',
        data: formData,
        datatype: 'json',
        async: false,
        success: function (jsonData) {
          if (jsonData.flag) {
            txt = msg;
          }
        }
      });
      return txt;
    }

    function limitDigit(thisObj) {
      $(thisObj).val($(thisObj).val().replace(/\D/g, ""));
    }

    function limitDigitDouble(thisObj) {
      $(thisObj).val($(thisObj).val().replace(/[^\d\.\/]/ig, ''));
    }

    function limitW(thisObj) {
      $(thisObj).val($(thisObj).val().replace(/[^\w\.\/]/ig, ''));
    }

    function title(columnNum) {
      $("table.layui-table tr").each(function () {
        var txt = $(this).find("td").eq(columnNum).text();
        $(this).find("td").eq(columnNum).attr("title", txt);
      });
    }

    function mergeColumn(columnNum) {
      if ($("table.layui-table tr").length > 0) {
        var tdStrCur = "";
        var countCur = 0;
        var countNext = 0;
        var flag = false;
        var objCur;
        var objNext;
        $("table.layui-table tr").each(function () {
          if ($(this).find("td").eq(columnNum).find("div").text() != tdStrCur) {
            tdStrCur = $(this).find("td").eq(columnNum).text();
            countCur = 1;
            flag = true;
            objCur = $(this).find("td").eq(columnNum);
          } else if (objCur) {
            if ($(this).find("td").eq(columnNum).find("div").text() != "") {
              $(this).find("td").eq(columnNum).remove();
              countCur++;
              flag = false;
              objNext = objCur;
              countNext = countCur;
            }
          }
          if (flag && countCur != 1) {
            objNext.attr("rowspan", countNext);
          } else {
            if (objCur) {
              objCur.attr("rowspan", countCur);
            }
          }
        });
        if (objCur) {
          objCur.attr("rowspan", countCur);
        }
      }
    }

    Date.prototype.format = function (format) {
      var o = {
        "M+": this.getMonth() + 1, //month
        "d+": this.getDate(), //day
        "H+": this.getHours(), //hour
        "m+": this.getMinutes(), //minute
        "s+": this.getSeconds(), //second
        "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
        "S": this.getMilliseconds() //millisecond
      };

      if (/(y+)/.test(format)) {
        format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
      }

      for (var k in o) {
        if (new RegExp("(" + k + ")").test(format)) {
          format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
        }
      }
      return format;
    };
  </script>
</th:block>
<th:block th:fragment="layui">
  <style>
    fieldset {
      margin: 5px 0 !important;
    }

    .layui-table-view {
      margin: 0 !important;
    }

    .layui-table {
      margin: 0 !important;
    }

    .layui-form-item:last-child {
      margin-bottom: 0px !important;
    }

    .layui-form-item {
      margin-bottom: 5px !important;
    }
  </style>
  <link rel="stylesheet" th:href="@{/layui-v2.5.4/layui/css/layui.css}" media="all"/>
  <script th:src="@{/layui-v2.5.4/layui/layui.js}" charset="utf-8"></script>
</th:block>

<th:block th:fragment="layui-dtree">
  <link rel="stylesheet" th:href="@{/plugins/layui_ext/dtree/dtree.css}">
  <link rel="stylesheet" th:href="@{/plugins/layui_ext/dtree/font/dtreefont.css}">
</th:block>


</html>